<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/commons/jsp/taglibs.jsp"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="frame" uri="http://www.framework.com/taglib"%>
<%@taglib uri="http://www.framework.com/taglib/tree" prefix="tree"%>
<form name="addDataForm" id="addMenuDataForm" method="post" action="${ctx}/framework/menu/save">
	<input type="hidden" name="id" value="${menu.id}"/>
	<input type="hidden" name="createTime" value="<fmt:formatDate value='${menu.createTime}' pattern='yyyy-MM-dd HH:mm:ss'/>"/>
	<input type="hidden" name="createrId" value="${menu.createrId}"/>
	<input type="hidden" name="createrName" value="${menu.createrName}"/>
	<table class="infoTable">
		<tbody>
		<tr>
			<th align="right" width="10%">菜单名称</th>
			<td><input name="name" class="easyui-validatebox" size="30" value="${menu.name}" data-options="required:true" maxlength="50"/>
			</td>
			<th align="right" width="10%">上级机构</th>
			<td><input name="pName" class="easyui-validatebox" readonly="readonly" id="pName" size="30" value="${menu.pName}" data-options="required:true" maxlength="50"/>
			<input type="hidden" name="pid" id="menuPid" class="easyui-validatebox" value="${menu.pid}" data-options="required:true"/>
			<span id="pModel" style="width: 100px;height: 100px;"><a href="javascript:void(0);" onclick="selectParentModel()"><img src="${ctx}/commons/themes/icons/icon5.png" border="0" title="上级部门"/></a></span>
			</td>
		</tr>
		<tr>
			<th align="right" width="10%">排序值</th>
			<td colspan="1"><input name="disSort" class="easyui-validatebox" size="20" value="${menu.disSort}" data-options="validType:['number']" maxlength="11"/>
			</td>
			<th align="right" width="10%">页面展示</th>
			<td>
			<c:choose>
				<c:when test="${empty menu.isNewWindow}">
				<c:forEach items="${frame:dictChildren('display_page')}" var="p">
					<input type="radio" name="isNewWindow" value="${p.value}" checked="checked"/>&nbsp;${p.name}&nbsp;
				</c:forEach>
				</c:when>
				<c:otherwise>
					<c:forEach items="${frame:dictChildren('display_page')}" var="p">
						<c:choose>
						<c:when test="${menu.isNewWindow==p.value}">
						<input type="radio" name="isNewWindow" value="${p.value}" checked="checked"/>&nbsp;${p.name}&nbsp;
						</c:when>
						<c:otherwise>
							<input type="radio" name="isNewWindow" value="${p.value}"/>&nbsp;${p.name}&nbsp;
						</c:otherwise>
						</c:choose>
					</c:forEach>
				</c:otherwise>
			</c:choose>
			</td>
		</tr>
		<tr>
			<th align="right" width="10%">连接路径</th>
			<td colspan="3"><input name="hrefUrl" class="easyui-validatebox" size="80" value="${menu.hrefUrl}" maxlength="80"/>
			</td>
		</tr>
		<tr>
			<th align="right" width="10%">菜单说明</th>
			<td colspan="3">
				<textarea rows="3" style="width: 580px;" id="remark" name="remark" onkeyup="checkLength('remarkError',50,'remark')">${menu.remark}</textarea>
				<font color="red"><br />注：50个字符以内，还可以输入<span class="input_font" id="remarkError">50</span>个字符</font>
			</td>
		</tr>
		</tbody>
	</table>
	<tree:modelTree ctx="${ctx}" modelIds="menuPid" modelNames="pName" selectMethod="single" />
</form>
<script type="text/javascript">
	function selectParentModel(){
		selmenuPidModelTree($('#menuPid').val());
		$('#menuPidModelTreeDialog').dialog('open');
	}
</script>
